import request from '@/utils/request'

//查询新闻列表
export function listNews(query) {
  return request({
    url: '/news/concern/list',
    method: 'get',
    params: query
  })
}

// 查询新闻详细
export function getNews(id) {
  return request({
    url: '/news/concern/' + id,
    method: 'get'
  })
}

// 新增新闻
export function addNews(data) {
  return request({
    url: '/news/concern/add',
    method: 'post',
    data: data
  })
}

// 修改新闻
export function updateNews(data) {
  return request({
    url: '/news/concern/update',
    method: 'put',
    data: data
  })
}

// 删除新闻
export function delNews(id) {
  return request({
    url: '/news/concern/' + id,
    method: 'delete'
  })
}

// 修改首页是否显示
export function upateIfIndex(id, ifIndex) {
  const data = {
    id,
    ifIndex
  }
  return request({
    url: '/news/concern/changeIfIndex',
    method: 'put',
    data: data
  })
}

// 新闻图片上传
export function uploadFileImg(data) {
  return request({
    url: '/news/concern/upload',
    method: 'post',
    data: data
  })
}

// 行业咨询
export function listIndustry(query) {
  return request({
    url: '/news/concern/listIndustry',
    method: 'get',
    params: query
  })
}

// 新增行业咨询
export function addIndustry(data) {
  return request({
    url: '/news/concern/addIndustry',
    method: 'post',
    data: data
  })
}

export function batchUpdateStatus(data) {
  return request({
    url: '/news/concern/batchUpdateStatus',
    method: 'post',
    data: data
  })
}

export function updateStatus(data) {
  return request({
    url: '/news/concern/updateStatus',
    method: 'post',
    data: data
  })
}